package com.mstore.service;

import java.util.ArrayList;
import java.util.List;

import com.mstore.dao.LogConsumeExamineDao;
import com.mstore.pojo.Consume;

public class LogConsumeExamineService {

	private LogConsumeExamineDao logConsumeExamineDao;

	/**
	 * 修改审核通过标示
	 */
	public void updateLogConsumeExamineFlag(Consume consume) {
		logConsumeExamineDao.updateLogConsumeExamineFlag(consume);
	}

	/**
	 * 根据条件查询
	 */
	public List<Consume> getLogConsumeExamineByCondition(
			Consume consume) {
		List<Consume> consumes = new ArrayList<Consume>();
		List<Object> list = logConsumeExamineDao
				.getLogConsumeExamineByCondition(consume);
		for (Object object : list) {
			consumes.add((Consume) object);
		}
		return consumes;
	}
	
	/**
	 * 根据条件查询消费总额
	 */
	public Double getSumMoneyByCondition(Consume consume) {
		return logConsumeExamineDao.getSumMoneyByCondition(consume);
	}
	
	/**
	 * 查询同一小票号的个数
	 */
	public int getCountSmallBanks(Consume consume) {
		return logConsumeExamineDao.getCountSmallBanks(consume);
	}

	public LogConsumeExamineDao getLogConsumeExamineDao() {
		return logConsumeExamineDao;
	}

	public void setLogConsumeExamineDao(
			LogConsumeExamineDao logConsumeExamineDao) {
		this.logConsumeExamineDao = logConsumeExamineDao;
	}

}
